<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('选择支行')" />
</head>
<body class="gray-bg">
<input type="hidden" name="head_bank" id="head_bank" th:value="${head_bank}">
<div class="col-sm-12 search-collapse">
	<form id="formId">
		<div class="select-list">
			<ul>
				<li>
					支行名称：
					<input type="text" name="branch_bank"/>
				</li>
				<li>
					<label>省：</label>
					<input type="text" name="province"/>
				</li>

				<li>
					<label>市：</label>
					<input type="text" name="city"/>
				</li>
				<li>
					<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
					<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
				</li>
			</ul>
		</div>
	</form>
</div>
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"  class="table text-nowrap"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        $(function() {
			var sm_status = [[${@dict.getType('sm_status')}]];
			var options = {
				url: ctx + "bankInfo/bankInfo/list2",
				showSearch: false,
				showRefresh: false,
				showToggle: false,
				showColumns: false,
				clickToSelect:true,
				queryParams:queryParams,
				columns: [{
					radio: true
				},
					{
						field : 'BRANCH_BANK',
						title : '支行名称'
					},
					{
						field : 'LIANHANGHAO',
						title : '支付系统行号'
					},
					{
						field : 'PROVINCE',
						title : '账户开户地_省'
					},
					{
						field : 'CITY',
						title : '账户开户地_区'
					}
					]
			};
            $.table.init(options);
        });

		//查询参数
		function queryParams(params) {
			var search = $.table.queryParams(params);
			search.head_bank = $("#head_bank").val();
			return search;
		}
        
        /* 添加用户-选择用户-提交 */
		function submitHandler(index, layero) {
			var BRANCH_BANK = $.table.selectColumns("BRANCH_BANK");
			var LIANHANGHAO = $.table.selectColumns("LIANHANGHAO");

			if (BRANCH_BANK.length == 0) {
       			$.modal.alertWarning("请至少选择一条记录");
       			return;
       		}
			$.modal.close();
			//修改父页面值
		    parent.$("#branch_bank").val(BRANCH_BANK);
			parent.$("#bankNum").val(LIANHANGHAO);




		}
    </script>
</body>
</html>